<?php 
/*
 * 用户反馈
 */
namespace Admin\Controller;

use Think\Controller;

class SuggestController extends Controller{
    
    public function __construct() {
        parent::__construct();
        $l = D('Login', 'Logic');
        $re = $l->islogin();
        if (!$re) {
            redirect('/admin/login');
        }
        $this->suggest = new \Home\Logic\QuestionnaireLogic();
    }

    /* 建议列表 */
    public function index() {
        $page = (int) $_GET['p'];
        $list = $this->suggest->getSuggestByPage($page);
        $this->assign('page',$list['page']);
        $this->assign('list',$list['list']);
        $this->display('index');
    }
    
    /*标示已处理*/
    public function dispose(){
        $id = (int)$_GET['id'];
        if($id>0){
            $re = $this->suggest->dispose($id);
        }
        echo $re==true?'true':'false';
        exit;
    }
    
}